<template>
  <div :style="{ top: (posY - 50) + 'px', left: posX + 'px' }" class="popStay-wrap popHD">
    <i class="el-icon-error close" @click="close" />
    <span class="title">
      <!-- <img v-show="remarks.WLevel === 1" class="icon" src="~@/assets/map/village/1.png" alt="">
      <img v-show="remarks.WLevel === 2" class="icon" src="~@/assets/map/village/2.png" alt=""> -->
      {{ remarks.addvnm || remarks.addvcd }}</span>
    <!-- <img class="line" src="../../../assets/map/popHD/popHD-line.png" alt=""> -->
    <div v-if="remarks.wordPath === null" class="pop-row">
      <span class="key">预案状态：</span>
      <span class="value">未更新</span>
      <!-- <span v-if="remarks.wLevel === 1" class="value">极危险</span>
      <span v-else-if="remarks.wLevel === 2" class="value">危险</span>
      <span v-else-if="remarks.wLevel === 3" class="value">警戒</span>
      <span v-else-if="remarks.wLevel === 4" class="value">关注</span> -->
    </div>
    <div v-if="remarks.wordPath != null" class="pop-row">
      <span class="key">预案状态：</span>
      <span class="value">已更新</span>
      <span class="valuelink" @click="showDetail">查看</span>
    </div>
    <i class="el-icon-caret-bottom arrow" />
  </div>
</template>
<script>
import pop from '../mixins/popPosStay'
export default {
  name: 'Pop',
  mixins: [pop],
  data() {
    return {}
  },
  computed: {
    remarks: function () {
      return this.$store.getters.popStayParams.remarks
    }
  },
  mounted() {
    this.$nextTick(() => {

    })
  },
  methods: {
    showDetail() {
      const dlgParams = this.$store.getters.dlgParams
      dlgParams.name = 'reserveSee'
      dlgParams.params = {}
      dlgParams.params.url = this.remarks.wordPath
      this.$store.dispatch('dlgParams', dlgParams)
      this.close()
    },
    close() {
      this.$store.dispatch('closePopStay')
    }
  }
}
</script>

<style lang="scss" scoped>
.popStay-wrap {
  position: absolute;
  z-index: 5;
  width: 200px;
  height: 100px;

  &.popHD {
    background: url("../../../assets/map/popHD/popHD-frame.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    .title {
      font-size: 16px;
      font-family: PingFang SC;
      font-weight: bold;
      line-height: 22px;
      color: #FCF9F6;
      align-self: flex-start;
    }

    .line {
      width: 90%;
    }
  }
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  cursor: pointer;
}

.arrow {
  position: absolute;
  bottom: -14px;
  font-size: 24px;
  // color: #4141be;
  // color: #3d3dd3;
  color: #2E85F5;
}

.icon {
  width: 16px;
  height: 16px;
}

.pop-row {
  width: 100%;
  display: flex;
  // align-items: center;
  // justify-content: space-around;
  justify-content: flex-start;
  line-height: 16px;

  .key {
    font-size: 12px;
    font-family: PingFang SC;
    font-weight: 500;
    line-height: 16px;
    color: #DDE8F8;
    white-space: nowrap;
  }

  .value {
    font-size: 12px;
    font-family: PingFang SC;
    font-weight: 500;
    line-height: 16px;
    color: #DDE8F8;
  }

  .valuelink {
    color: #1c75e8;
  }

  .nowarp {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn {
    background: url(../../../assets/map/popHD/btnPlay.png) no-repeat top center;
    background-size: 100% 100%;
    padding: 10px 20px 7px 20px;
    margin: 0 5px;
    letter-spacing: 2px;

    &:hover {
      background: url(../../../assets/map/popHD/btnPlay_active.png) no-repeat top center;
      background-size: 100% 100%;
    }
  }
}</style>
